<template>
  <el-card class="progress-box">
    <div class="time-line flex padding-tb-sm ">
      <template v-for="(item, index) in progressList">
        <el-popover
          v-if="item.remark"
          placement="bottom"
          :width="250"
          class="text-center flex-sub tiem-line-item "
          :class="{ 'text-gray': !item.state }"
          :key="index"
          trigger="hover"
        >
          <div><span class="text-blue">备注信息:</span>{{ item.remark }}</div>

          <div slot="reference" class="text-center pointer text-cut">
            <div class="text-cut padding-bottom-lg">{{ item.content }}</div>
            <div class=" text-cut" style="min-height:14px">
              {{ item.operationDateTime }}
            </div>
          </div>
        </el-popover>
        <div
          v-else
          :key="index"
          class="text-center flex-sub tiem-line-item pointer text-cut"
          :class="{ 'text-gray': !item.state }"
        >
          <div class="text-cut padding-bottom-lg">{{ item.content }}</div>
          <div class=" text-cut" style="min-height:14px">
            {{ item.timestamp }}
          </div>
        </div>
      </template>
    </div>
  </el-card>
</template>

<script>
export default {
  props: {
    progressList: {
      type: Array,
      default: function() {
        return []
      }
    }
  },
  data() {
    return {}
  }
}
</script>

<style lang="scss" scoped>
.progress-box {
  margin: 0 0 15px;
}

.tiem-line-item {
  position: relative;
  &::before {
    content: '';
    position: absolute;
    top: calc(50% - 1px);
    left: 0%;
    border-top: 2px solid #43c9a2;
    width: 100%;
  }
  &::after {
    content: '';
    position: absolute;
    top: calc(50% - 6px);
    left: calc(50% - 6px);
    border-radius: 50%;
    width: 12px;
    height: 12px;
    background: #43c9a2;
  }
}

.text-gray.tiem-line-item {
  &::before {
    border-top: 2px solid #94a0b3;
  }
  &::after {
    background: #94a0b3;
  }
}

.tracking-head {
  padding-left: 68px;
  font-size: 12px;
  font-weight: bold;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #94a0b3;
}

.tab-lable {
  color: #94a0b3;
}
</style>
